import 'package:dio/dio.dart';
import 'package:flutter_enjoy_plus/constants/index.dart';
import 'package:flutter_enjoy_plus/utils/RequestDio.dart';

// 获取验证码
Future getCodeAPI(Map<String, dynamic> params) {
  return requestDio.get(HTTP_PATH.GET_CODE, params: params);
}

// 登录接口
Future loginAPI(Map<String, dynamic> data) {
  return requestDio.post(HTTP_PATH.LOGIN, data: data);
}

// 获取用户信息
Future getUserInfoAPI() {
  return requestDio.get(HTTP_PATH.USER_INFO);
}

// 修改用用户信息
Future updateUserInfoAPI(Map<String, dynamic> data) {
  return requestDio.put(HTTP_PATH.USER_INFO, data: data);
}

// 上传头像或图片
Future uploadFileAPI(FormData data) {
  return requestDio.upload(HTTP_PATH.UPLOAD_IMAGE, data: data);
}
